<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js" integrity="sha384-eMNCOe7tC1doHpGoWe/6oMVemdAVTMs2xqW4mwXrXsW0L84Iytr2wi5v2QjrP/xp" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.min.js" integrity="sha384-cn7l7gDp0eyniUwwAZgrzD06kc/tftFf19TOAs2zVinnD/C7E91j9yyk5//jjpt/" crossorigin="anonymous"></script>
  <title> Уязвимое демо приложение для DevSecOps</title>
</head>
<body bg-light>
<nav th:fragment="navbar" class="navbar navbar-expand-md bg-success navbar-dark .sticky-top">
  <div class="container-fluid">
    <a class="navbar-brand"  th:href="@{/}"><p class="h2">VulnApp</p>
    </a>
    <ul class="navbar-nav">
      <li><a class="nav-link" th:href="@{/}">Домой</a></li>
      <li><a class="nav-link active" th:href="@{/data}">Внести данные</a></li>
      <li><a class="nav-link" th:href="@{/search}">Поиск</a></li>
      <li class="nav-item">
        <div class="form-check form-switch ms-auto mt-2 me-2">
          <label class="form-check-label ms-3" for="lightSwitch">
            <svg
                    xmlns="http://www.w3.org/2000/svg"
                    width="25"
                    height="25"
                    fill="currentColor"
                    class="bi bi-brightness-high"
                    viewBox="0 0 16 16"
            >
              <path
                      d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"
              />
            </svg>
          </label>
          <input class="form-check-input" type="checkbox" id="lightSwitch" />
        </div>
      </li>
    </ul>
  </div>
</nav>
<br /><br /><br />
<div class="container mt-5">
    <div class="row col-md-8 offset-md-2">
      <div class="card">
        <div class="card-header">
          <h2 class="text-center text-dark">Добавить локацию</h2>
        </div>
        <div th:if="${param.success}">
          <div class="alert alert-info">
            Вы успешно добавили локацию!
          </div>
        </div>
        <div class="card-body">
          <form
                  method="post"
                  role="form"
                  th:action="@{/data/add}"
                  th:object="${location}"
          >
            <div class="form-group mb-3">
              <label class="form-label text-dark">Имя локации</label>
              <input
                      class="form-control"
                      id="firstName"
                      name="firstName"
                      placeholder="Введите имя локации"
                      th:field="*{coordinates}"
                      type="text"
              />
              <p th:errors = "*{coordinates}" class="text-danger"
                 th:if="${#fields.hasErrors('coordinates')}"></p>
            </div>

            <div class="form-group mb-3">
              <label class="form-label text-dark">Код локации</label>
              <input
                      class="form-control"
                      id="code"
                      name="code"
                      placeholder="Введите код локации"
                      th:field="*{code}"
                      type="text"
              />
              <p th:errors = "*{code}" class="text-danger"
                 th:if="${#fields.hasErrors('code')}"></p>
            </div>
            <div class="form-group">
              <button class="btn btn-primary btn-success" type="submit">Добавить</button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
<script src="/../static/js/switch.js" th:src="@{/js/switch.js}"></script>
</body>
</html>